import {parse} from 'qs';

export default {
    namespace: 'messageItem',
    state: {

    },
    reducers: {
        /**
         * 是否显示
         *
         * @param state
         * @param action
         * @returns {{showStatus: (boolean|*)}}
         */
        setEditModel(state, action) {
            let payload = action.payload;

            let newState = {...state.editModel};
            if(payload.showStatus != undefined) {
                newState.showStatus = payload.showStatus;
            }
            if(payload.width != undefined) {
                newState.width = payload.width;
            }
            if(payload.title != undefined) {
                newState.title = payload.title;
            }
            if(payload.confirmLoading != undefined) {
                newState.confirmLoading = payload.confirmLoading;
            }
            if(payload.step != undefined) {
                newState.step = payload.step;
            }

            if(payload.customsMode != undefined) {
                newState.customsMode = payload.customsMode;
            }
            if(payload.cencasementMode != undefined) {
                newState.cencasementMode = payload.cencasementMode;
            }
            if(payload.wordSendMode != undefined) {
                newState.wordSendMode = payload.wordSendMode;
            }
            return {...state, editModel: {...newState}};
        }
    },
    effects: {
    },
    subscriptions: {
    }
};
